<div class='shopcart-list' ng-controller='ShopcartList'>
    <div class='goods am-g am-g-collapse' ng-repeat='item in cart.list'>
        <div class='am-u-sm-4 banner' ng-click='detail(item.id)'>
            <img ng-src='{{item.banner}}'>
            <div class='tag'>
                <img src='../image/tag/hot.png' ng-if='item.tag == 1'>
                <img src='../image/tag/new.png' ng-if='item.tag == 2'>
            </div>
        </div>
        <div class='am-u-sm-7 info' ng-click='detail(item.id)'>
            <div class='name'>{{item.name}}</div>
            <div class='intro font-info'>
                <img class='icon' src='../image/icon/user.png' align="absmiddle">
                {{item.teacher_name}} 共{{item.chapter}}章节{{item.cart_id}}
            </div>
            <div class='buy-count font-info'>
                <span ng-if='course.price == 0'>{{course.buy_count}}人已体验</span>
                <span ng-if='course.price != 0'>{{course.buy_count}}人已购买</span>
            </div>
            <div class='price-money font-info'>
                <img class='icon' src='../image/icon/money.png' align="absmiddle">{{item.price}}
            </div>
        </div>

        <button class='btn btn-delete' ng-click='goods_remove(item)'>删除</button>
    </div>
    
    <div class='box-coupon-btn'>
        <button class='am-btn am-btn-warning' data-am-modal='{target: ".am-modal.input-coupon"}'>使用优惠码</button>
    </div>
    <div class='am-modal input-coupon'>
        <div class='am-modal-dialog'>
            <div class='am-modal-hd'>
                输入优惠码
                <a href="javascript: void(0)" class="am-close am-close-spin" data-am-modal-close>&times;</a>
            </div>
            <div class='am-modal-bd'>
                <input type='text' class='am-form-field' ng-model='coupon.code'>
                <span class='error-msg'>{{coupon.tip}}&nbsp;</span>
            </div>
            <div class='am-modal-footer'>
                <button class='am-btn am-btn-sm' data-am-modal-close>取消</button>
                <button class='am-btn am-btn-warning am-btn-sm' ng-click='check_code()'>确定</button>
            </div>
        </div>
    </div>

    <!-- <div class='box-coupon am-g am-g-collapse'>
        <div class='am-u-sm-2'>优惠码:</div>
        <div class='am-u-sm-8'>
            <input type='text' class='am-form-field' ng-model='coupon.code'>
        </div>
        <div class='am-u-sm-2'>
            <i class='fa fa-spin fa-spinner check-code-loading'></i>
        </div>
    </div>
    <div class='coupon-tip'>{{coupon.tip}}</div> -->

    <div style='height: 100px'></div>
    <div class='box-cart am-g am-g-collapse' ng-if='cart.amount'>
        <div class='am-u-sm-3 icon'>
            <img src='../image/course/shop-cart.png'>
            <span>{{cart.count}}</span>
        </div>
        <div class='am-u-sm-5 tip'>
            <div>总金额:<span class='amount'>¥{{cart.amount}}</span></div>
            <div>实付款:<span class='amount'>¥{{cart.amount - coupon.amount}}</span></div>
        </div>
        <div class='am-u-sm-4'>
            <button class='am-btn am-btn-warning am-btn-block' ng-click='start_pay()'>立即购买</button>
        </div>
    </div>
</div>